// lib/constants/text_styles.dart

import 'package:flutter/material.dart';
import 'colors.dart';
import 'package:my_flutter_demo/exports.dart';

class AppTextStyles {
  // 标题样式
  static const TextStyle headline1 = TextStyle(
    fontSize: 96.0,
    fontWeight: FontWeight.w300,
    letterSpacing: -1.5,
    color: AppColors.onBackground,
  );

  static const TextStyle headline2 = TextStyle(
    fontSize: 60.0,
    fontWeight: FontWeight.w300,
    letterSpacing: -0.5,
    color: AppColors.onBackground,
  );

  static const TextStyle headline3 = TextStyle(
    fontSize: 48.0,
    fontWeight: FontWeight.w400,
    color: AppColors.onBackground,
  );

  static const TextStyle headline4 = TextStyle(
    fontSize: 34.0,
    fontWeight: FontWeight.w400,
    letterSpacing: 0.25,
    color: AppColors.onBackground,
  );

  static const TextStyle headline5 = TextStyle(
    fontSize: 24.0,
    fontWeight: FontWeight.w400,
    color: AppColors.onBackground,
  );

  static const TextStyle headline6 = TextStyle(
    fontSize: 20.0,
    fontWeight: FontWeight.w500,
    letterSpacing: 0.15,
    color: AppColors.onBackground,
  );

  // 正文样式
  static const TextStyle bodyText1 = TextStyle(
    fontSize: 16.0,
    fontWeight: FontWeight.w400,
    letterSpacing: 0.5,
    color: AppColors.onBackground,
  );

  static const TextStyle bodyText2 = TextStyle(
    fontSize: 14.0,
    fontWeight: FontWeight.w400,
    letterSpacing: 0.25,
    color: AppColors.onBackground,
  );

  // 按钮文本
  static const TextStyle button = TextStyle(
    fontSize: 14.0,
    fontWeight: FontWeight.w500,
    letterSpacing: 1.25,
    color: AppColors.onPrimary,
  );

  // 说明文字
  static const TextStyle caption = TextStyle(
    fontSize: 12.0,
    fontWeight: FontWeight.w400,
    letterSpacing: 0.4,
    color: AppColors.grey600,
  );

  // 输入框提示
  static const TextStyle overline = TextStyle(
    fontSize: 10.0,
    fontWeight: FontWeight.w400,
    letterSpacing: 1.5,
    color: AppColors.grey600,
  );

  // 自定义文本样式扩展
  static TextStyle get subtitle1 => const TextStyle(
    fontSize: 16.0,
    fontWeight: FontWeight.w400,
    letterSpacing: 0.15,
  );

  static TextStyle subtitle2(Color color) => TextStyle(
    fontSize: 14.0,
    fontWeight: FontWeight.w500,
    letterSpacing: 0.1,
    color: color,
  );

  // 响应式文本大小
  static TextStyle responsiveText(BuildContext context, double scale) {
    final baseSize = MediaQuery.of(context).textScaleFactor * 14;
    return TextStyle(fontSize: baseSize * scale);
  }
}